import { getID } from '@/utils';
// 组件
import Main from '@/pages_components/detail/Main';
import Order from '@/pages_components/detail/Order';

const pageType = '/car';
const CarDetail = ({ router, ssr, ssr_data }) => {
    const { path } = router.query;
    const {
        projectId,
        goodsName,
        poiAddress = "",
        description,
        destinationName,
        showPicture = [],
        goodsExtendListAppDTOS = [],
        priceDesc,
        method,
        note,
        discountCouponListDTO = {},
        algorithms
    } = ssr_data;
    
    return (
        <Main
            params={{
                id: getID(path),
                name: "用车",
                routes: [
                    { name: '用车包车', url: pageType },
                    { name: '用车详情', url: `${pageType}/${path}` }
                ]
            }}
            data={{
                ssr,
                goodsName,
                poiAddress,
                description,
                destinationName,
                showPicture,
                goodsExtendListAppDTOS,
                priceDesc,
                method,
                note,
                discountCouponListDTO,
                algorithms
            }}
            recomend={{
                name: '推荐景区',
                target: "/ticket"
            }}
        >
            <Order target={pageType} projectId={projectId} destinationName={destinationName} algorithms={algorithms} />
        </Main>
    )
}
export default CarDetail